<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="Access-Control-Allow-Origin" content="*" />
    <title>云设计中心</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="stylesheet" href="/seeyonStatic/common/all-min.css">
    <link rel="stylesheet" href="/seeyonStatic/skin/dist/common/skin.css">
    <link rel="stylesheet" href="/seeyonStatic/skin/dist/components/components_theme_default.css">
    <link rel="stylesheet" href="/seeyonStatic/skin/dist/components/components_layout.css">
</head>

<body>
    <script>
        var _ctxPath="/seeyon";
        var _locale = "zh_CN";
    </script>
    <script  type="text/javascript" src="/seeyonStatic/common/all-min.js"></script>
    <script  type="text/javascript" src="/seeyonStatic/common/cap.js"></script>
    <script>
        function openInstallDialog (fileId,type,data){
            //type 1  创建新应用   2 本地更新应用   3 更新在线应用
            var installParams = {
                fileId:fileId,
                resetId:false,
                setupType:'local',
                source:'',
                title: "应用安装向导",
                upgrade: false,
                upgradeAppId: "",
                url: "",
                version: ""
            };
            if(type&&type != 1&&data){
                installParams.title = '应用升级向导';
                installParams.upgrade = true;
                installParams.setupType = "local";
                if(data.source){
                    installParams.source = data.source;
                }
                installParams.upgradeAppId = data.id;
            }else if(type == 3&&data){
                installParams.setupType = "online";
                installParams.url = data.url;
            }
            var dialog = $.dialog({
                id: 'bizSetupDialog',
                url: _ctxPath + '/common/cap4/bizconfig/managementCenter/index.html',
                width: 880,
                height: 510,
                title: installParams.title,
                transParams: installParams,
                checkMax: true,
                closeParam: {
                    'show': false,
                    autoClose: false,
                    handler: function () {
                        var res = dialog.getReturnValue({
                            type: "close"
                        });
                        installParams.bizConfigId = res.bizConfigId;
                        callBackendMethod("capAppSetupManager", "cancelSetup", installParams);
                    }
                },
                buttons: [{
                    id: 'next',
                    text: "下一步",
                    handler: function () {
                        dialog.startLoading();
                        var resut = dialog.getReturnValue({
                            type: "next"
                        });
                        if (resut) {
                            dialog.close();
                        }
                    }
                }, {
                    id: 'cancel',
                    text: '取消',
                    handler: function () {
                        top.$.confirm({
                            'msg': '取消安装或关闭安装窗口会清空已配置数据，确定吗？',
                            ok_fn: function () {
                                dialog.endLoading();
                                var res = dialog.getReturnValue({
                                    type: "close"
                                });
                                installParams.bizConfigId = res.bizConfigId;
                                callBackendMethod("capAppSetupManager",
                                    "cancelSetup", installParams);
                                dialog.close();
                            },
                            cancel_fn: function () {

                            }
                        });
                    }
                }, {
                    id: 'OK',
                    text: "完成",
                    hide: true,
                    handler: function () {
                        var result = dialog.getReturnValue({
                            type: "complate"
                        });
                        //capTop.refreshCap4Menu();
                        if (result && result.hasBaseData) { //点击完成时如果有基础数据，则弹出基础数据导入窗口
                            dialog.endLoading();
                            dialog.close();
                           // that.openBaseDataImportDialog(result,that);
                        } else {
                            dialog.endLoading();
                            dialog.close();
                            //that.updateAppList(that);
                        }
                    }
                }]
            });
        }
    </script>
</body>

</html>